package com.demo.util;

import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @ClassName GetApplication
 * @Description TODO
 * @Author Windy
 * @Date 2022/8/26 11:48
 * @Version 1.0
 **/
public class GetApplication {
    private static ClassPathXmlApplicationContext context = null;

    public static ClassPathXmlApplicationContext getInstance(){
        if (context == null) {
            context=new ClassPathXmlApplicationContext("beans.xml");
        }
        return context;
    }
    //关闭链接
    public static void closeContext(){
        context.close();
    }
}
